<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Document</title>
</head>
<body>
<button onclick="add()">两数运算结果</button>
</body>
<script>
function add() {
let s1 = parseFloat(prompt("请输入第一个数"))
let s2 = parseFloat(prompt("请输入第二个数"))
let y = prompt("请输入运算符号")
document.write(s1 + y + s2 + "=")
if (y === '*') {2
let count = s1 * s2
document.write(count)
} else if (y === "/") {
let count = s1 / s2
document.write(count)
} else if (y === "+") {
let count = s1 + s2
document.write(count)
} else if (y === "-") {
let count = s1 - s2
document.write(count)
} else {
alert("输入错误！！！")
}
}
</script>
</html>